package com.mz.ozy.activity.me;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.mz.ozy.R;
import com.mz.ozy.base.BaseActivity;
import com.mz.ozy.bean.FriendBean;
import com.mz.ozy.bean.MyBounsBean;
import com.mz.ozy.bean.MyBounsRecodeBean;
import com.mz.ozy.bean.NewBonusBean;
import com.mz.ozy.bean.NewBonusDetailBean;
import com.mz.ozy.bean.NewBonusDonateBean;
import com.mz.ozy.bean.NewGQBean;
import com.mz.ozy.bean.NewMyExtendBean;
import com.mz.ozy.bean.NewMyExtendInfoBean;
import com.mz.ozy.bean.PronotionBean;
import com.mz.ozy.mvp.presenter.ExtendPresenter;
import com.mz.ozy.mvp.presenter.MyBounsPresenter;
import com.mz.ozy.mvp.view.ExtendContract;
import com.mz.ozy.mvp.view.MyBonusContract;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MyExtendActivity extends BaseActivity<MyBonusContract.View, MyBounsPresenter> implements MyBonusContract.View {

    @BindView(R.id.tv_total)
    TextView tvTotal;

    @BindView(R.id.level_1_num)
    TextView level_1_num;

    @BindView(R.id.level_2_num)
    TextView level_2_num;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_extend);

        ButterKnife.bind(this);
        initTitle();
        tvCenterTitle.setText("分享列表");

        mPresenter.newBonus(this);
    }

    @OnClick({R.id.level_1, R.id.level_2, R.id.bnt_hand_report, R.id.tv_extend})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.level_1:
            {
                MyExtendListActivity.go(MyExtendActivity.this, 1);
            }
                break;
            case R.id.level_2:
            {
                MyExtendListActivity.go(MyExtendActivity.this, 2);
            }
                break;

            case R.id.bnt_hand_report:
                startActivity(new Intent(MyExtendActivity.this, HandReportActivity.class));
                break;

            case R.id.tv_extend:
                startActivity(new Intent(MyExtendActivity.this, InviteCodeActivity.class));
                break;
        }
    }

    @Override
    public void getInfoSuccess(MyBounsBean bean) {

    }

    @Override
    public void getInfoRecode(MyBounsRecodeBean bean) {

    }

    @Override
    public void getVipUpShSuccess(FriendBean bean) {

    }

    @Override
    public void getVipUpDataInfoSuccess(PronotionBean bean) {

    }

    @Override
    public void newBonusSuccess(NewBonusBean bean) {
        if (bean != null) {
            tvTotal.setText((bean.exp1 + bean.exp2) + "");
            level_1_num.setText(bean.exp1 + "");
            level_2_num.setText(bean.exp2 + "");
        }
    }

    @Override
    public void newBonusDetailSuccess(NewBonusDetailBean bean) {

    }

    @Override
    public void newBonusDonateSuccess(NewBonusDonateBean bean) {

    }

    @Override
    public void newGQSuccess(NewGQBean bean) {

    }
}